package ar.com.fracervellera.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class User {
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Key key;
	@Persistent
	private String username;
	@Persistent
	private String name;
	@Persistent
	private String surname;
	@Persistent
	private com.google.appengine.api.users.User emailId;
	@Persistent
	private String password;
	
	
	public User(Key key, String username, String name, String surname,
			com.google.appengine.api.users.User emailId, String password) {
		super();
		setKey(key);
		setUsername(username);
		setName(name);
		setSurname(surname);
		setEmailId(emailId);
		setPassword(password);
	}
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		if(username != null && !username.isEmpty()) {
			this.username = username;
		}
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		if(name != null && !name.isEmpty()) {
			this.name = name;
		}
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		if(surname != null && !surname.isEmpty()) {
			this.surname = surname;
			
		}
	}
	public com.google.appengine.api.users.User getEmailId() {
		return emailId;
	}
	public void setEmailId(com.google.appengine.api.users.User emailId) {
		if(emailId != null) {
			this.emailId = emailId;
		}
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		if(password != null && !password.isEmpty()) {
			this.password = password;
		}
	}
	public void setKey(Key key) {
		if(key != null) {
			this.key = key;
		}
	}
	public Key getKey() {
		return key;
	}
	
	
}
